package com.ming.springcloud.consumer.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

@Service
public class BookRibbonService {
    @Autowired
    RestTemplate restTemplate;

    public String findBooks(){
        return restTemplate.getForObject("http://student-service-provider/book/findAllBooks", String.class);
    }

    public String findBooksById(Integer id){
        return restTemplate.getForObject("http://student-service-provider/book/findBooksById/"+id, String.class);
    }
}
